import javax.swing.*;
import java.awt.*;

public class MyFrame extends JFrame{
	public MyFrame(){		
	}
	public static void main(String[] args){
		
		JFrame frame = new JFrame();
		frame.setSize(300,300);
		frame.setLocationRelativeTo(null);
		frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
		frame.setLayout(new GridLayout(3,1));
		
		JPanel topPanel = new JPanel();
		topPanel.setLayout(new FlowLayout());
		JComboBox baseBox = new JComboBox(new Object [] {"dec", "rat", "hex", "oct"});
		baseBox.setSelectedItem("dec");
		baseBox.setPreferredSize(new Dimension(150,20));
		topPanel.add(baseBox);
		
		JComboBox formatBox = new JComboBox(new Object [] {"fixed", "float", "rat"});
		formatBox.setSelectedItem("fixed");
		formatBox.setPreferredSize(new Dimension(150,20));
		topPanel.add(formatBox);
		
		frame.add(topPanel);
		
		JPanel midPanel = new JPanel();
		midPanel.setLayout(new FlowLayout());
		JTextField input = new JTextField();
		input.setColumns(8);
		midPanel.add(input);
		JButton opBtn = new JButton("Operand");
		midPanel.add(opBtn);
		JButton addBtn = new JButton("+");
		midPanel.add(addBtn);
		JButton minBtn = new JButton("-");
		midPanel.add(minBtn);
		JButton mulBtn = new JButton("*");
		midPanel.add(mulBtn);
		JButton divBtn = new JButton("/");
		midPanel.add(divBtn);		
		frame.add(midPanel);
		
		JPanel botPanel = new JPanel();
		botPanel.setLayout(new BorderLayout());
		JTextArea hist = new JTextArea();
		JScrollPane scrollPane = new JScrollPane(hist);
		hist.setEditable(false);
		botPanel.add(scrollPane,BorderLayout.CENTER);
		JPanel botCenterPanel = new JPanel();
		botCenterPanel.setLayout(new FlowLayout());
		JLabel histLabel = new JLabel("Calculation History");
		botCenterPanel.add(histLabel);
		botPanel.add(botCenterPanel,BorderLayout.NORTH);
		frame.add(botPanel);
		
		
		frame.setVisible(true);
	}
}
